#include<bits/stdc++.h>
using namespace std;
char jm(char c , int k){
	int flag = 'a';
	if (c <= 'Z') {
		flag = 'A';
		c = c + 'a' - 'A';
	}
	int diff = (c - 'a') - k;
	if (diff < 0) {
		diff += 26;
	} 
	
	char m = flag + diff;
	return m;
}
int main(){
	freopen("vigenere.in" , "r" , stdin);
	freopen("vigenere.out" , "w" , stdout);
	string m , k , c;
	cin >> k;
	cin >> c;
	int a = k.length();
	for(int i = 0 ; i < c.length() ; i++){
		int diff = tolower(k[i % a]) - 'a';
		cout << jm(c[i] , diff);
	}
	cout << endl; 
	return 0;
}
